import request from '@/utils/request'

// 查询工单工序记录列表
export function listWorkOrderProcess(query) {
  return request({
    url: '/production/workorderprocess/list',
    method: 'get',
    params: query
  })
}

// 查询工单工序记录详细
export function getWorkOrderProcess(processId) {
  return request({
    url: '/production/workorderprocess/' + processId,
    method: 'get'
  })
}

// 新增工单工序记录
export function addWorkOrderProcess(data) {
  return request({
    url: '/production/workorderprocess',
    method: 'post',
    data: data
  })
}

// 修改工单工序记录
export function updateWorkOrderProcess(data) {
  return request({
    url: '/production/workorderprocess',
    method: 'put',
    data: data
  })
}

// 删除工单工序记录
export function delWorkOrderProcess(processId) {
  return request({
    url: '/production/workorderprocess/' + processId,
    method: 'delete'
  })
}

// 根据工单ID查询工序记录列表
export function listByOrderId(orderId) {
  return request({
    url: '/production/workorderprocess/listByOrderId/' + orderId,
    method: 'get'
  })
}

// 根据工单编号查询工序记录列表
export function listByOrderCode(orderCode) {
  return request({
    url: '/production/workorderprocess/listByOrderCode/' + orderCode,
    method: 'get'
  })
}

// 根据设备ID查询工序记录列表
export function listByEquipmentId(equipmentId) {
  return request({
    url: '/production/workorderprocess/listByEquipmentId/' + equipmentId,
    method: 'get'
  })
}

// 根据操作工ID查询工序记录列表
export function listByWorkerId(workerId) {
  return request({
    url: '/production/workorderprocess/listByWorkerId/' + workerId,
    method: 'get'
  })
}

// 根据状态查询工序记录列表
export function listByStatus(status) {
  return request({
    url: '/production/workorderprocess/listByStatus/' + status,
    method: 'get'
  })
}